using System;
using System.Collections.Generic;
using System.Linq;

namespace Corelib.Entities
{
	[Table(Name = "dbo.PostalModes")]
	public class PostalMode
	{

		#region Private Data Members

		private int  _postalModeID;
		private string  _postalModeName;

		#endregion

		#region Private "Static" Data Members

		private static readonly string[] _propertyNames = new string[] {
			"PostalModeID",
			"PostalModeName",
		};

		#endregion

		#region Constants

		public const int 
			FieldPostalModeIDIdx = 0,
			FieldPostalModeNameIdx = 1;

		#endregion

		#region Private instance data members

		private FieldInfo[] _fieldInfo = new FieldInfo[]{
			new FieldInfo(FieldPostalModeIDIdx,FieldType.Primitive),
			new FieldInfo(FieldPostalModeNameIdx,FieldType.Primitive),
		};

		#endregion

		#region Public Properties

		[Column(DBType = "int not null")]
		public int PostalModeID
		{
			get { return this.GetHelper(_fieldInfo, _propertyNames, FieldPostalModeIDIdx,  _postalModeID); }
			set {  _postalModeID = this.SetValueTypeHelper(_fieldInfo, FieldPostalModeIDIdx,  _postalModeID, value,  _postalModeID == value); }
		}

		[Column(DBType = "nvarchar(20) not null")]
		public string PostalModeName
		{
			get { return this.GetHelper(_fieldInfo, _propertyNames, FieldPostalModeNameIdx,  _postalModeName); }
			set {  _postalModeName = this.SetValueTypeHelper(_fieldInfo, FieldPostalModeNameIdx,  _postalModeName, value,  _postalModeName == value); }
		}

		#endregion
	}
}
